﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApp.App.Code.Cms
{
    public class Channel
    {
        public static Dictionary<string, Models.Entity.Common.channel> channelDic = null;
        public Channel()
        {
            if (channelDic == null)
            {
                Models.DAL.Cms.Channel channel = new Models.DAL.Cms.Channel();
                NRapid.List<Models.Entity.Common.channel> channels = channel.GetChannel();
                channelDic = new Dictionary<string, Models.Entity.Common.channel>();
                foreach (var ch in channels)
                {
                    channelDic.Add(ch.id.ToString(), ch);
                }
            }
        }
        public Models.Entity.Common.channel GetValue(string id)
        {
            return channelDic["id"];
        }
    }
}